package com.augurit.gzcgwsp.excelimportexport.dao;


import java.util.List;

import org.hibernate.Criteria;
import org.hibernate.Session;
import org.hibernate.criterion.Restrictions;
import org.springframework.stereotype.Repository;

import com.augurit.common.base.dao.BaseDao;
import com.augurit.gzcgwsp.excelimportexport.entity.YwRqQyjyxkRqjszdjb;

/**
 * 广州市燃气经营许可证许可审批------六、燃气接收站、储配站、汽车加气站登记表
 * @author xgw
 *
 */
@Repository
public class YwRqQyjyxkRqjszdjbDao extends BaseDao<YwRqQyjyxkRqjszdjb, Long>{

    public Long saveEntity(YwRqQyjyxkRqjszdjb entity) {
       Session session=this.getSession();
       Long id=(Long) session.save(entity);
       return id;
    }

    public YwRqQyjyxkRqjszdjb getEntity(Long id) {
        Session session=this.getSession();
        Criteria criteria=session.createCriteria(YwRqQyjyxkRqjszdjb.class);
        criteria.add(Restrictions.eq("id", id));
        List<YwRqQyjyxkRqjszdjb> list=criteria.list();
        if(list!=null && list.size()>0)
        return list.get(0);
       return null;
    }
}
